<template>
    <div class="newslist">
        <a :href='item.aurl' v-for="item in newslist" track-by="$index">
            <ul class='newslist_unit cbafter'>
                <li class='newstit'>
                    <div class="newsdetailtit">
                        <h2>{{item.infoTitle}}</h2>
                        <p><span> {{item.infoApplyUserName}}  {{item.levelText}}</span><span>{{item.infoVerifyTime}}</span></p>
                    </div>
                </li>
                <li class='newsimg'><img :src='item.infoTitlePicture'></li>
            </ul>
        </a>
        <!-- <div class="more cb" @click="getmoredata">加载更多>></div> -->
    </div>
</template>
<script>
import Public from 'assets/public.js'
module.exports = {
    data() {
            return {
                newslist: [],

            }
        },
        props: {
            "getlistopt": {
                type: Object,
                default: function() {
                    return {
                        "infoType": "", //资讯类别：字典base_informationType,所有资讯是传""或者null
                        "newInfoFlag": "1", //是否为最新资讯标签, "1"为是
                        "pageNo": 1 //页数
                    }
                },
            },

        },
        ready() {
            this.getlist();

        },
        methods: {
            getlist() {
                    var that = this;
                    let shareObjType = "041";
                    let shareObjId = "21673535f2024dff885fb197c4449ad9";
                    $.when(Public.commonajax("coms.healthMessageService", "queryValidMessage", "[" + JSON.stringify(this.getlistopt) + "]")).done(
                        function(res) {
                            if (res.code == 200) {
                                $.each(res.body, function(index, el) {
                                    el.infoVerifyTime = el.infoVerifyTime.substring(0, 10);
                                    el.aurl = "apphealthnews.html?sharedObjId=" + el.infoId + "&shareObjType=" + shareObjType + "&shareObjId=" + shareObjId;
                                    el.infoTitlePicture = Public.IMGVIEW_URL() + el.infoTitlePicture;
                                });
                                that.newslist = res.body;
                            }
                        })
                },
                // getmoredata() {
                //     this.getlistopt.pageNo++;
                //     this.getlist();
                // }
        },
        watch: {


        },
        events: {
            // 'editarea' (editarea) {
            //     console.log(this.selected);
            //     this.selected = editarea
            // }
        }
}
</script>
<style scoped>
.newslist {
    width: 100%;
}

.newslist a {
    display: block;
    padding: 10px;
    border-bottom: 1px dotted #f1f1f1;
}

.newslist_unit {
    width: 100%;
    box-sizing: border-box;
}

.newslist_unit li {
    float: left;
}

.newslist_unit .newsimg img {
    width: 75px;
    border-radius: 6px;
    height: 70px;
}

.newslist_unit .newstit {
    width: 70%;
}

.newslist_unit .newsimg {
    width: 25%;
    margin-left: 5%
}

.newsdetailtit {
    line-height: 26px;
    font-size: 14px;
}

.newsdetailtit h2 {
    line-height: 26px;
    font-size: 14px;
}

.newsdetailtit p span {
    display: block;
    padding: 0 10px 0 20px;
    color: #ccc;
    line-height: 22px;
}

.newsdetailtit p span:nth-child(1) {
    background: url(../assets/img/userbg.png) no-repeat left center;
    background-size: 15px 15px;
}

.newsdetailtit p span:nth-child(2) {
    background: url(../assets/img/timeover.png) no-repeat left center;
    background-size: 12px 12px;
}

.more {
    height: 40px;
    width: 100%;
    line-height: 40px;
    color: #23be82;
    text-align: center;
    font-size: 12px
}
</style>
